package com.xx.douyi.config;

import com.xx.douyi.Interceptor.RepeatSubmitInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description: com.xx.douyi.config
 * @Author: ruby
 * @CreateTime: 2023-03-20 17:06
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    RepeatSubmitInterceptor repeatSubmitInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LogInterceptor())
                .excludePathPatterns("/dy/**");
        registry.addInterceptor(repeatSubmitInterceptor);
    }
}
